API Documentation
Public Member Functions | List of all members
nkGraphics::BlendStateManager Class Reference

Manages the blend states available in the component. More...

Inheritance diagram for nkGraphics::BlendStateManager:

Public Member Functions

 ~BlendStateManager ()
 
BlendStatecreateOrRetrieve (const std::string_view &name)
 
BlendStateget (const std::string_view &name)
 
BlendStategetByIndex (unsigned int index)
 
void rename (const std::string_view &oldName, const std::string_view &newName)
 
void erase (const std::string_view &name)
 
BlendStategetDefaultState () const
 

Detailed Description

Manages the blend states available in the component.

The manager owns the memory it allocates. External code should never free memory returned.

Constructor & Destructor Documentation

◆ ~BlendStateManager()

nkGraphics::BlendStateManager::~BlendStateManager ( )

Destructor.

Member Function Documentation

◆ createOrRetrieve()

BlendState* nkGraphics::BlendStateManager::createOrRetrieve ( const std::string_view &  name)

Creates if unavailable, or retrieves if available, a state.

Parameters
nameThe name of the state to retrieve.
Returns
A new state, potentially freshly created. The manager owns the memory returned, external code should never delete it. See erase().

◆ get()

BlendState* nkGraphics::BlendStateManager::get ( const std::string_view &  name)

Retrieves a state.

Parameters
nameThe name of the state to retrieve.
Returns
The state requested if available, nullptr else.

◆ getByIndex()

BlendState* nkGraphics::BlendStateManager::getByIndex ( unsigned int  index)

Retrieves a state by index. Note that an index can map to different states as the internal memory is changed. Mainly used for looping over all states in one go.

Parameters
indexThe index of the state to retrieve.
Returns
The state requested if available, nullptr else.

◆ rename()

void nkGraphics::BlendStateManager::rename ( const std::string_view &  oldName,
const std::string_view &  newName 
)

Renames a state, changing both its name and the way to address it in the manager.

Parameters
oldNameThe name of the state to rename.
newNameThe new name to attach to it.

◆ erase()

void nkGraphics::BlendStateManager::erase ( const std::string_view &  name)

Erases and frees the memory allocated for a state.

Parameters
nameThe name of the state to erase.

◆ getDefaultState()

BlendState* nkGraphics::BlendStateManager::getDefaultState ( ) const
Returns
The default state used when no state is set for a pass.

The documentation for this class was generated from the following file: